#!/usr/bin/env python

import gtk

class signals:
   def __init__(self,blend):
      self.blend = blend;
      
   def on_response(self,widget,response,conv,wid):
      if response == gtk.RESPONSE_ACCEPT:
         text = None;
         if widget.entry.get_text() != None or widgt.entry.get_text() != "":
            text = widget.entry.get_text();

         if widget.samePasswordCheck is None:
            if text is None:
               # Uncheck Encrypt Messages in Chat Window...
               wid.set_active(False);
               return;
         else:
            if widget.samePasswordCheck.get_active():
               # Fetch
               text = conv.receiveEncryptKey;
            else:
               if text is None:
                  # Uncheck Encrypt Messages in Chat Window...
                  wid.set_active(False);
                  return;

         # Encrypt
         conv.enableEncryption(text);
         
         if widget.rememberKeyCheck.get_active():
            conv.rememberKeyOnce = False;
         else:
            conv.rememberKeyOnce = True;

      else:
         # Uncheck Encrypt Messages in Chat Window...
         wid.set_active(False);

      widget.destroy();